<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<h:head>
    <title>Login</title>

</h:head>
<h:body>
    <p:panel header="Login">
    <h:form id="login">
        <h3><p:outputLabel value="User Section" rendered="#{!LoginManaged.isAdmin}"/></h3>
        <h3><p:outputLabel value="Employee Section" rendered="#{LoginManaged.isAdmin}"/></h3>
        <p:outputLabel value="#{LoginManaged.errorMessage}"/>
        <h:panelGrid columns="2" cellpadding="5">
            <p:outputLabel value="Username:" rendered="#{!LoginManaged.isAdmin}"/>
            <p:outputLabel value="EmployeeCode" rendered="#{LoginManaged.isAdmin}"/>
            <p:inputText id="username" value="#{LoginManaged.username}"/>
            <p:outputLabel value="Password:"/>
            <p:password id="password" value="#{LoginManaged.password}"/>
            <p:commandButton id="submit" value="Login" action="#{LoginManaged.login}"
                             ajax="false" />
        </h:panelGrid>
    </h:form>
    <h:link value="Register" outcome="registration" rendered="#{!LoginManaged.isAdmin}"/>
    <h:link value="Back to home" outcome="index"/>
    </p:panel>
    <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
</h:body>
</html>